﻿@using AntUnion.FrameWork.Util;
@model AntUnion.FrameWork.Model.Models.CrmUser
@{
    ViewData["Title"] = "Index";
    Layout = "~/Areas/Console/Views/Shared/_Layout.cshtml";
}
@section head{
    <script type="text/javascript">
        var table;
        layui.config({
            base: '../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'table', 'form', 'upload', 'laydate'], function () {
            var $ = layui.$
                , form = layui.form
                , admin = layui.admin
                , table = layui.table
                , laydate = layui.laydate
                , upload = layui.upload;
            top.SetFormPageLanguage(layui);

            /*修改手机 开始*/
            form.on('input-affix(editphone)', function (data) {
                var elem = data.elem;
                top.OpenPageByKey(layui, "editPhone", 2, '90%', '90%', '/Personal/Phone');
            });
            /*修改手机 结束*/


            /*修改邮箱开始*/
            $('#loginAccount').click(function (data) {
                var elem = data.elem;
                top.OpenPageByKey(layui, "editEmail", 2, '90%', '90%', '/Personal/Email');
            });
            /*修改邮箱 结束*/

            /*修改密码 开始*/
            $('#loginPassword').click(function (data) {
                var elem = data.elem;
                top.OpenPageByKey(layui, "editPassword", 2, '90%', '90%', '/Personal/Password');
            });
            /*修改密码 结束*/

            /*个人信息 开始*/
            var countryLanguage = "country-zh-CN.json";
            switch (top.thisLanguages) {
                case "manage-zh-CN":
                case "user-zh-CN":
                    countryLanguage = "country-zh-CN.json";
                    break;
                case "manage-en-US":
                case "user-en-US":
                    countryLanguage = "country-en-US.json";
                    break;
            }

            $.getJSON("/language/" + countryLanguage, function (result) {
                $('#countryRegion').append(new Option(top.lang.pleaseSelect, ""));
                $.each(result, function (key) {
                    $('#countryRegion').append(new Option(result[key], key));
                });
                if ($("#HideCountryRegion").val() != "") {
                    $('#countryRegion').val($("#HideCountryRegion").val());
                }
                layui.form.render("select");
            });

            $('#gender').append(new Option(top.lang.pleaseSelect, ""));
            $('#gender').append(new Option(top.lang.male, "male"));
            $('#gender').append(new Option(top.lang.female, "female"));
            $('#gender').append(new Option(top.lang.secrecy, "secrecy"));

            if ($("#HideGender").val() != "") {
                $('#gender').val($("#HideGender").val());
            }
            layui.form.render("select");

            $('#idType').append(new Option(top.lang.pleaseSelect, ""));
            $('#idType').append(new Option(top.lang.passport, "passport"));
            $('#idType').append(new Option(top.lang.IDcard, "IDcard"));
            if ($("#HideIDType").val() != "") {
                $('#idType').val($("#HideIDType").val());
            }
            layui.form.render("select");

            //日期范围
            laydate.render({
                elem: '#birthday'
            });

            //$('#personalInformation *').prop('disabled', true);
            //$('#financialInformation *').prop('disabled', true);
            //$('#personalInformation *').addClass('layui-disabled').prop('disabled', true);
            //$('#financialInformation *').addClass('layui-disabled').prop('disabled', true);
            //未审核，不禁用只有提交按钮
             if ($('#personalType').val() === "-1") {
                $('#personalInfoEdit').addClass('layui-hide');
                $('#personalInfoConfirmBtn').removeClass('layui-hide');
                $('#personalInfoCancel').addClass('layui-hide');
            }
            //审核中，禁用且没有按钮
           else if ($('#personalType').val() === "0") {
                $('#personalInformation *').addClass('layui-disabled').prop('disabled', true);
                $('#personalInfoEdit').addClass('layui-hide');
                $('#personalInfoConfirmBtn').addClass('layui-hide');
                $('#personalInfoCancel').addClass('layui-hide');
            }
            //拒绝，不禁用且有提交按钮
            else if ($('#personalType').val() === "1") {
                $('#personalInformation *').removeClass('layui-disabled').prop('disabled', false);
                $('#personalInfoEdit').addClass('layui-hide');
                $('#personalInfoConfirmBtn').removeClass('layui-hide');
                $('#personalInfoCancel').addClass('layui-hide');
            }
            //通过，禁用，但可以编辑和取消
            else if ($('#personalType').val() === "2") {
                $('#personalInformation *:not([id="idType"], [id="idNo"], [id="name"]').removeClass('layui-disabled').prop('disabled', false);
               //$('#personalInformation *:([id="idType"], [id="idNo"], [id="name"])').addClass('layui-disabled').prop('disabled', true);
                $('#personalInformation').find('#idType, #idNo, #name').addClass('layui-disabled').prop('disabled', true);
                $('#personalInfoEdit').removeClass('layui-hide');
                $('#personalInfoConfirmBtn').addClass('layui-hide');
                $('#personalInfoCancel').removeClass('layui-hide');
            }

            form.on('submit(personalInfoEdit)', function (data) {
                $('#personalInfoEdit').addClass('layui-hide');
                $('#personalInfoConfirmBtn').removeClass('layui-hide');
                $('#personalInfoCancel').removeClass('layui-hide');
                if ($('#personalType').val() == "2") {
                    $('#personalInformation *:not([id="idType"], [id="idNo"], [id="name"]').removeClass('layui-disabled').prop('disabled', false);
                }
                else {
                    $('#personalInformation *').removeClass('layui-disabled').prop('disabled', false);
                }
                layui.form.render("select");
            });

            form.on('submit(personalInfoCancel)', function (data) {
                $('#personalInfoEdit').removeClass('layui-hide');
                $('#personalInfoConfirmBtn').addClass('layui-hide');
                $('#personalInfoCancel').addClass('layui-hide');
                $('#personalInformation *').addClass('layui-disabled').prop('disabled', true);
                layui.form.render("select");
            });

            form.on('submit(personalInfoConfirmBtn)', function (data) {
                var inputModels = [];
                var inputsAndSelects = $('.personalInformation .personInput');
                inputsAndSelects.each(function () {
                    if ($(this).attr("name") == "HideCountryRegion" || $(this).attr("name") == "HideGender") {
                        return;
                    }
                    if ($(this).attr("name") !== null && $(this).attr("name") !== "") {
                        var inputModel = {
                            "type": $(this)[0].tagName,
                        };

                        switch ($(this)[0].tagName) {
                            case "INPUT":
                                inputModel.name = $(this).attr("id");
                                inputModel.value = $(this).val();
                                break;
                            case "SELECT":
                                inputModel.name = $(this).attr("id");
                                inputModel.value = $("#" + $(this).attr("name")).val();
                                break;
                            case "IMG":
                                inputModel.name = $(this).attr("id");
                                inputModel.value = $("#" + $(this).attr("id")).attr('src');
                                break;
                            case "LABEL":
                                inputModel.name = $(this).attr("id");
                                inputModel.value = $('input[name="' + $(this).attr("id") + '"]:checked').val();
                                break;
                        }
                        inputModels.push(inputModel);
                    }
                });
                $.ajax({
                    type: "POST",
                    url: "/Personal/EditCrmInfo",
                    data: {
                        "type": 1,
                        "inputModels": inputModels
                    },
                    async: true,
                    error: function (request) {
                        alert("Connection error");
                    },
                    beforeSend: function (xhr) {
                        layui.layer.load();
                    },
                    success: function (data) {
                        var item = eval(data);
                        if (item.code == 0) {
                            /**提示语弹框 */
                            top.ShowMessageByKey(layui, item.msg, 6, 1000, function () {
                                location.reload();
                                parent.layui.index.openTabsPage("/Personal/Index");
                                //初始化导航选项卡（选中新建标签卡）
                                parent.layui.element.render('nav');
                            });
                        } else {
                            /**提示语弹框 */
                            top.AlertByKey(layui, item.msg, 0);
                        }
                        layer.closeAll('loading');
                    }
                });
                return false;
            });
            /*个人信息 结束*/

            /*财务信息 开始*/
              if ($('#financialInType').val() === "-1") {
                $('#financialInfoEdit').addClass('layui-hide');
                $('#financialInfoConfirmBtn').removeClass('layui-hide');
                $('#financialInfoCancel').addClass('layui-hide');
              }
           else  if ($('#financialInType').val() === "0") {
                $('#financialInformation *').addClass('layui-disabled').prop('disabled', true);
                $('#financialInfoEdit').addClass('layui-hide');
                $('#financialInfoConfirmBtn').removeClass('layui-hide');
                $('#financialInfoCancel').addClass('layui-hide');
            } else if ($('#financialInType').val() === "1") {
                $('#financialInformation *').addClass('layui-disabled').prop('disabled', false);
                $('#financialInfoEdit').removeClass('layui-hide');
                $('#financialInfoConfirmBtn').addClass('layui-hide');
                $('#financialInfoCancel').removeClass('layui-hide');

            } else if ($('#financialInType').val() === "2") {
                $('#financialInformation *').addClass('layui-disabled').prop('disabled', true);
                 $('#financialInfoEdit').removeClass('layui-hide');
                $('#financialInfoConfirmBtn').addClass('layui-hide');
                $('#financialInfoCancel').removeClass('layui-hide');
            }

            form.on('submit(financialInfoEdit)', function (data) {
                $('#financialInfoEdit').addClass('layui-hide');
                $('#financialInfoConfirmBtn').removeClass('layui-hide');
                $('#financialInfoCancel').removeClass('layui-hide');
                $('#financialInformation *').removeClass('layui-disabled').prop('disabled', false);
                layui.form.render("select");
            });

            form.on('submit(financialInfoCancel)', function (data) {
                $('#financialInfoEdit').removeClass('layui-hide');
                $('#financialInfoConfirmBtn').addClass('layui-hide');
                $('#financialInfoCancel').addClass('layui-hide');
                $('#financialInformation *').addClass('layui-disabled').prop('disabled', true);
                layui.form.render("select");
            });

            form.on('submit(financialInfoConfirmBtn)', function (data) {
                var inputModels = [];
                var inputsAndSelects = $('.financialInformation .personInput');
                inputsAndSelects.each(function () {
                    if ($(this).attr("name") == "HideCountryRegion" || $(this).attr("name") == "HideGender") {
                        return;
                    }
                    if ($(this).attr("name") !== null && $(this).attr("name") !== "") {
                        var inputModel = {
                            "type": $(this)[0].tagName,
                        };
                        switch ($(this)[0].tagName) {
                            case "INPUT":
                                inputModel.name = $(this).attr("id");
                                inputModel.value = $(this).val();
                                break;
                            case "SELECT":
                                inputModel.name = $(this).attr("id");
                                inputModel.value = $("#" + $(this).attr("name")).val();
                                break;
                            case "IMG":
                                inputModel.name = $(this).attr("id");
                                inputModel.value = $("#" + $(this).attr("id")).attr('src');
                                break;
                            case "LABEL":
                                inputModel.name = $(this).attr("id");
                                inputModel.value = $('input[name="' + $(this).attr("id") + '"]:checked').val();
                                break;
                        }
                        inputModels.push(inputModel);
                    }
                });
                //console.log(inputModels)
                $.ajax({
                    type: "POST",
                    url: "/Personal/EditCrmInfo",
                    data: {
                        "type": 2,
                        "inputModels": inputModels
                    },
                    async: true,
                    error: function (request) {
                        alert("Connection error");
                    },
                    beforeSend: function (xhr) {
                        layui.layer.load();
                    },
                    success: function (data) {
                        var item = eval(data);
                        if (item.code == 0) {
                            /**提示语弹框 */
                            top.ShowMessageByKey(layui, item.msg, 6, 1000, function () {
                                location.reload();
                                parent.layui.index.openTabsPage("/Personal/Index");
                                //初始化导航选项卡（选中新建标签卡）
                                parent.layui.element.render('nav');
                            });
                        } else {
                            /**提示语弹框 */
                            top.AlertByKey(layui, item.msg, 0);
                        }
                        layer.closeAll('loading');
                    }
                });
                return false;
            });
            /*财务信息 结束*/

            $(".uploadView").each(function () {
                var id = $(this).attr("id")
                //上传
                upload.render({
                    elem: '#' + id + "Upload"
                    , url: '/Base/UploadFile'
                    , accept: 'images'
                    , exts: 'jpg|png'
                    , done: function (res, index, upload) {
                        $('#' + id + "View").removeClass('layui-hide').find('img').attr('src', res.data.src);
                    }
                });
                //删除图片
                $('#' + id + 'Remove').click(function (res) {
                    //console.log(res)
                    //$("#upIcon").removeClass('layui-hide');
                    $('#' + id + "View").val('').find('img').attr('src', '');
                });
            });

            //图片预览事件
            $('.uploadShowView img').click(function (e) {
                previewImg(this);
                e.stopPropagation()
            });
        });
    </script>
}
    <div class="layui-fluid">
        <div class="layui-row ">
            <div class="layui-col-xs12">
                <div class="layui-card" style="text-align:center;">
                    <div class="layui-card-body personal-card">
                        <div class="layadmin-homepage-pad-ver">
                            @*<img class="layadmin-homepage-pad-img" src="../../layuiadmin/style/res/template/portrait.png" width="96" height="96">*@
                            <div class="head-image"> @Model.LoginName.Substring(0, 1)</div>
                            <div class="head-name"> @Model.LoginName</div>
                            <button type="button" class="layui-btn" id="loginAccount">变更登录账号</button>
                            <button type="button" class="layui-btn" id="loginPassword">修改登录密码</button>
                        </div>
                    </div>
                </div>
            </div>
            @*       <div class="layui-col-xs12 layui-col-md8">
        <div class="layui-card">
        <div class="layui-card-body personal-card">
        <div class="layui-form">
        <div class="layui-form-item">
        <div class="layui-input-group" style="margin: 0 auto;">
        <div class="layui-input-prefix">
        手机：
        </div>
        <div class="layui-input-wrap">
        <input type="text" lay-options="{split: true}" class="layui-input" value="@Model.Telephone" lay-affix="edit" lay-filter="editphone" readonly>
        </div>
        </div>
        </div>
        <div class="layui-form-item">
        <div class="layui-input-group" style="margin: 0 auto;">
        <div class="layui-input-prefix" lay-event="loginAccount" style="width:150px  !important;">
        变更登录账号：
        </div>
        <div class="layui-input-wrap">
        <input type="text" lay-options="{split: true}" class="layui-input" value="@Model.Email" lay-affix="edit" lay-filter="editemail" readonly>
        </div>
        </div>
        </div>
        <div class="layui-form-item">
        <div class="layui-input-group" style="margin: 0 auto;">
        <div class="layui-input-prefix" lay-event="loginPassword" style="width:150px  !important;">
        修改登录密码：
        </div>
        <div class="layui-input-wrap">
        <input type="password" lay-options="{split: true}" class="layui-input" value="@Model.LoginPwd" lay-affix="edit" lay-filter="editpassword" readonly>
        </div>
        </div>
        </div>
        </div>
        </div>
        </div>
        </div>*@
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-col-md12">
            <div class="layui-card overview-card">
                <div class="layui-card-body" style="text-align:center;">
                    <div class="layui-tab layui-tab-brief">
                        <ul class="layui-tab-title">
                            <li class="layui-this"  id="personalInfo" lay-event="personalInfo" >个人信息</li>
                            <li id="financialInfo" lay-event="financialInfo">财务信息</li>
                        </ul>
                        <div class="layui-tab-content">
                            <div class="layui-tab-item personalInformation layui-show">
                                <div class="layui-form">
                                    <div class="layui-col-xs6">
                                        <input id="personalType" name="personalType" type="hidden" value="@ViewBag.personalType" />
                                    @if (ViewBag.personalType == -1)
                                    {
                                        <span class="layui-badge layui-bg-black" lay-event="notReview" >未提交审核</span>
                                    }
                                    else if (ViewBag.personalType == 0)
                                    {
                                        <span class="layui-badge layui-bg-blue" lay-event="inReview" >审核中</span>
                                    }
                                    else if (ViewBag.personalType == 1)
                                    {
                                        <span class="layui-badge" lay-event="refuse" >拒绝</span>
                                        <span style="padding:0 10px;color:red;">@ViewBag.remark</span>
                                    }
                                    else if (ViewBag.personalType == 2)
                                    {
                                        <span class="layui-badge  layui-bg-green" lay-event="pass" >通过</span>
                                    }
                                </div>
                                <div id="personalInformation" class="layui-row layui-col-space10 layui-form-item disabled-container">
                                    @if (ViewBag.personalInformations != null)
                                    {
                                        List<AntUnion.FrameWork.Model.Models.CrmKyc> personalInformations = ViewBag.personalInformations as List<AntUnion.FrameWork.Model.Models.CrmKyc>;
                                        if (personalInformations != null && personalInformations.Count > 0)
                                        {
                                            foreach (AntUnion.FrameWork.Model.Models.CrmKyc crmKyc in personalInformations)
                                            {
                                                if (crmKyc.Name == "countryRegion" && crmKyc.Type == "select")
                                                {
                                                    <div class="layui-col-lg6">
                                                        <label class="layui-form-label" lay-event="@crmKyc.Name"></label>
                                                        @if (crmKyc.Required == 0)
                                                        {
                                                            <span class="required">*</span>
                                                        }
                                                        <div class="layui-input-block">
                                                            <select name="@crmKyc.Name" id="@crmKyc.ControlId" lay-search="" class="personInput">
                                                            </select>
                                                            <input id="HideCountryRegion" name="HideCountryRegion" type="hidden" value="@crmKyc.Value" />
                                                        </div>
                                                    </div>
                                                }
                                                else if (crmKyc.Name == "gender" && crmKyc.Type == "select")
                                                {
                                                    <div class="layui-col-lg6">
                                                        <label class="layui-form-label" lay-event="@crmKyc.Name"></label>
                                                        @if (crmKyc.Required == 0)
                                                        {
                                                            <span class="required">*</span>
                                                        }
                                                        <div class="layui-input-block">
                                                            <select name="@crmKyc.Name" id="@crmKyc.ControlId" lay-search="" class="personInput">
                                                            </select>
                                                            <input id="HideGender" name="HideGender" type="hidden" value="@crmKyc.Value" />
                                                        </div>
                                                    </div>
                                                }
                                                else if (crmKyc.Name == "idType" && crmKyc.Type == "select")
                                                {
                                                    <div class="layui-col-lg6">
                                                        <label class="layui-form-label" lay-event="@crmKyc.Name"></label>
                                                        @if (crmKyc.Required == 0)
                                                        {
                                                            <span class="required">*</span>
                                                        }
                                                        <div class="layui-input-block">
                                                            <select name="@crmKyc.Name" id="@crmKyc.ControlId" lay-search="" class="personInput">
                                                            </select>
                                                            <input id="HideIDType" name="HideIDType" type="hidden" value="@crmKyc.Value" />
                                                        </div>
                                                    </div>
                                                }
                                                else if (crmKyc.Type == "text")
                                                {
                                                    <div class="layui-col-lg6">
                                                        <label class="layui-form-label" lay-event="@crmKyc.Name"></label>
                                                        @if (crmKyc.Required == 0)
                                                        {
                                                            <span class="required">*</span>
                                                        }
                                                        <div class="layui-input-block">
                                                            <input type="@crmKyc.Type" id="@crmKyc.ControlId" name="@crmKyc.Name" placeholder="@crmKyc.Name" value="@crmKyc.Value" class="layui-input personInput">
                                                        </div>
                                                    </div>
                                                }
                                                else if (crmKyc.Type == "radio")
                                                {
                                                    @if (!string.IsNullOrEmpty(crmKyc.Config))
                                                    {
                                                        <div class="layui-col-xs12">
                                                            <label class="layui-input-block personInput" style="margin-left: 50px;" lay-event="@crmKyc.Name" id="@crmKyc.ControlId">@crmKyc.Name</label>
                                                            @if (crmKyc.Required == 0)
                                                            {
                                                                <span style="color:red;">*</span>
                                                            }
                                                            <div class="layui-input-block">
                                                                @foreach (AntUnion.FrameWork.Model.Models.CrmKycConfig config in JsonUtil.DeserializeJsonToList<AntUnion.FrameWork.Model.Models.CrmKycConfig>(crmKyc.Config))
                                                                {
                                                                    <input type="radio" name="@config.name" value="@config.value" title="@config.title" @(crmKyc.Value == config.value ? "checked" : "")>
                                                                }
                                                            </div>
                                                        </div>
                                                    }
                                                }
                                                else if (crmKyc.Type == "image")
                                                {
                                                    <div class="layui-col-lg6">
                                                        <label class="layui-form-label" lay-event="@crmKyc.ControlId">@crmKyc.Name</label>
                                                        @if (crmKyc.Required == 0)
                                                        {
                                                            <span class="required">*</span>
                                                        }
                                                        <div class="layui-upload-drag uploadView" id="@crmKyc.ControlId">
                                                            <div class="uploadShowView" id="@(crmKyc.ControlId+"View")">
                                                                <img src="@crmKyc.Value" class="personInput" style="max-width: 100px;max-height: 100px;" id="@(crmKyc.ControlId+"Img")">
                                                            </div>
                                                        </div>
                                                        <button type="button" class="layui-btn" id="@(crmKyc.ControlId+"Upload")"  lay-event="clickUpload">点击上传</button>
                                                        <button type="button" class="layui-btn layui-btn-danger" id="@(crmKyc.ControlId+"Remove")" lay-event="remove">移除</button>
                                                    </div>
                                                }
                                                else
                                                {
                                                    <div class="layui-col-lg6">
                                                        <label class="layui-form-label" lay-event="@crmKyc.Name"></label>
                                                        <div class="layui-input-block">
                                                            <input type="@crmKyc.Type" id="@crmKyc.ControlId" name="@crmKyc.Name" placeholder="@crmKyc.Name" value="@crmKyc.Value" class="layui-input">
                                                        </div>
                                                    </div>
                                                }
                                            }
                                        }
                                    }
                                </div>
                                <div class="tips">@Html.Raw(ViewBag.personalCenterWarmPrompt)</div>
                                @if (ViewBag.personalType != 0)
                                {
                                    <div class="layui-input-block">
                                        <button class="layui-btn layui-btn-sm" id="personalInfoEdit" lay-event="edit" lay-submit lay-filter="personalInfoEdit">编辑</button>
                                        <button class="layui-btn layui-btn-sm" id="personalInfoConfirmBtn" lay-event="confirmBtn" lay-submit lay-filter="personalInfoConfirmBtn">确认</button>
                                        <button class="layui-btn layui-btn-primary layui-btn-sm layui-hide" id="personalInfoCancel" lay-event="cancel" lay-submit lay-filter="personalInfoCancel">取消</button>
                                    </div>
                                }
                            </div>
                        </div>
                        <div class="layui-tab-item financialInformation">
                            <div class="layui-form">
                                <div class="layui-col-xs6">
                                    <input id="financialInType" name="financialInType" type="hidden" value="@ViewBag.financialInType" />
                                    @if (ViewBag.financialInType == -1)
                                    {
                                        <span class="layui-badge layui-bg-black"  lay-event="notReview" >未提交审核</span>
                                    }
                                    else if (ViewBag.financialInType == 0)
                                    {
                                        <span class="layui-badge layui-bg-blue"  lay-event="inReview" >审核中</span>
                                    }
                                    else if (ViewBag.financialInType == 1)
                                    {
                                        <span class="layui-badge"  lay-event="refuse" >拒绝</span>
                                        <span style="padding:0 10px;color:red;">@ViewBag.remark</span>
                                    }
                                    else if (ViewBag.financialInType == 2)
                                    {
                                        <span class="layui-badge  layui-bg-green" lay-event="pass">通过</span>
                                    }
                                </div>
                                <div id="financialInformation" class="layui-row layui-col-space10 layui-form-item">
                                    @if (ViewBag.financialInformations != null)
                                    {
                                        List<AntUnion.FrameWork.Model.Models.CrmKyc> financialInformations = ViewBag.financialInformations as List<AntUnion.FrameWork.Model.Models.CrmKyc>;
                                        if (financialInformations != null && financialInformations.Count > 0)
                                        {
                                            foreach (AntUnion.FrameWork.Model.Models.CrmKyc crmKyc in financialInformations)
                                            {
                                                if (crmKyc.Type == "text")
                                                {
                                                    <div class="layui-col-lg6">
                                                        <label class="layui-form-label" lay-event="@crmKyc.Name"></label>
                                                        @if (crmKyc.Required == 0)
                                                        {
                                                            <span class="required">*</span>
                                                        }
                                                        <div class="layui-input-block">
                                                            <input type="@crmKyc.Type" id="@crmKyc.ControlId" name="@crmKyc.Name" placeholder="@crmKyc.Name" value="@crmKyc.Value" class="layui-input">
                                                        </div>
                                                    </div>
                                                }
                                                else if (crmKyc.Type == "radio")
                                                {
                                                    @if (!string.IsNullOrEmpty(crmKyc.Config))
                                                    {
                                                        <div class="layui-col-xs12">
                                                            <label class="layui-input-block" style="margin-left: 50px;" lay-event="@crmKyc.Name" id="@crmKyc.ControlId">@crmKyc.Name</label>
                                                            @if (crmKyc.Required == 0)
                                                            {
                                                                <span style="color:red;">*</span>
                                                            }
                                                            <div class="layui-input-block">
                                                                @foreach (AntUnion.FrameWork.Model.Models.CrmKycConfig config in JsonUtil.DeserializeJsonToList<AntUnion.FrameWork.Model.Models.CrmKycConfig>(crmKyc.Config))
                                                                {
                                                                    <input type="radio" name="@config.name" value="@config.value" title="@config.title" @(crmKyc.Value == config.value ? "checked" : "")>
                                                                }
                                                            </div>
                                                        </div>
                                                    }
                                                }
                                                else if (crmKyc.Type == "image")
                                                {
                                                    <div class="layui-col-lg6">
                                                        <label class="layui-form-label" lay-event="@crmKyc.ControlId">@crmKyc.Name</label>
                                                        @if (crmKyc.Required == 0)
                                                        {
                                                            <span class="required">*</span>
                                                        }
                                                        <div class="layui-upload-drag uploadView" id="@crmKyc.ControlId">
                                                            <div class="uploadShowView" id="@(crmKyc.ControlId+"View")">
                                                                <img src="@crmKyc.Value" class="personInput" style="max-width: 100px;max-height: 100px;" id="@(crmKyc.ControlId+"Img")">
                                                            </div>
                                                        </div>
                                                        <button type="button" class="layui-btn" id="@(crmKyc.ControlId+"Upload")">点击上传</button>
                                                        <button type="button" class="layui-btn layui-btn-danger" id="@(crmKyc.ControlId+"Remove")">移除</button>
                                                    </div>
                                                }
                                                else
                                                {
                                                    <div class="layui-col-lg6">
                                                        <label class="layui-form-label" lay-event="@crmKyc.Name"></label>
                                                        <div class="layui-input-block">
                                                            <input type="@crmKyc.Type" id="@crmKyc.ControlId" name="@crmKyc.Name" placeholder="@crmKyc.Name" @crmKyc.Value class="layui-input">
                                                        </div>
                                                    </div>
                                                }
                                            }
                                        }
                                    }
                                </div>
                                <div class="tips">@Html.Raw(ViewBag.financeWarmPrompt)</div>
                                @if (ViewBag.financialInType != 0)
                                {
                                    <div class="layui-input-block">
                                        <button class="layui-btn layui-btn-sm" id="financialInfoEdit" lay-event="edit" lay-submit lay-filter="financialInfoEdit">编辑</button>
                                        <button class="layui-btn layui-btn-sm" id="financialInfoConfirmBtn" lay-event="confirmBtn" lay-submit lay-filter="financialInfoConfirmBtn">确认</button>
                                        <button class="layui-btn layui-btn-primary layui-btn-sm layui-hide" id="financialInfoCancel" lay-event="cancel" lay-submit lay-filter="financialInfoCancel">取消</button>
                                    </div>
                                }
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>